{include file='_header'}
<div class="page-header">
    当前位置：<span class="text-primary">商户统计</span>
</div>
<div class="page-content">
      <form action="" method="get" class="form-horizontal table-search" role="form">
          <div class="page-toolbar row m-b-sm m-t-sm">
              <div class="col-sm-5">
                  {:tpl_daterange('datetime', array('sm'=>true,'placeholder'=>'按订单时间查询'),true);}
              </div>
              <div class="col-sm-6 pull-right">
                  <div class="input-group">
                      <div class="input-group-select">
                          <select name='groupname' class='form-control  input-sm select-md'   style="width:120px;">
                              <option value='' {if $groupname==''}selected{/if}>商户组</option>
                              {foreach name='groups' key='key' item='val'}
                              <option value='{$val['id']}' {if $groupname==$val['id']}selected{/if}>{$val['groupname']}</option>
                              {/foreach}
                          </select>
                      </div>
                      <input type="text" class="form-control input-sm" name="realname" value="{$realname}" placeholder="可搜索商户名称/姓名/手机号"/>
                     <span class="input-group-btn">
                         <button class="btn btn-primary" type="submit"> 搜索</button>
                         <button type="submit" name="export" value="1" class="btn btn-success">导出</button>
                    </span>
                  </div>
              </div>
          </div>
      </form>
        {if empty(count($list))}
        <div class='panel panel-default'>
            <div class='panel-body' style='text-align: center;padding:30px;'>
                暂时没有任何商户!
            </div>
        </div>
        {else}
            <table class="table table-hover table-responsive">
                <thead class="navbar-inner">
                    <tr>
                        <!--<th style="width:25px;"><input type='checkbox' /></th>-->
                        <th style="width:150px;">商城信息</th>
                        <th style="width:120px;">商户信息</th>
                        <th style="width:100px;">订单应收</th>
                        <th style="width:100px;">订单抵扣</th>
                        <th style="width:100px;">订单会员折扣</th>
                        <th style="width:100px;">订单促销</th>
                        <th style="width:100px;">订单实收</th>
                        <!--th style="width:70px;">操作</th-->
                    </tr>
                </thead>
                <tbody>
                    {foreach name='list' item='row'}
                    <tr>
                        <!--<td style="position: relative; "><input type='checkbox'   value="{$row['id']}"/></td>-->
                        <td  >
                        <div  >
                            {if !empty($row['logo'])}
                             <img src='{$row['logo']}' style='width:30px;height:30px;padding1px;border:1px solid #ccc' onerror="this.src='/public/static/images/nopic.png'" />
                           {/if}
                            {$row['merchname']}
                            </div>
                        </td>
                        <td>{$row['realname']}<br/>{$row['mobile']}</td>

                        <td>{$row['goodsprice']+$row['dispatchprice']}</td>
                        <td>积分：<span class="text-primary">{:floatval($row['deductprice'])}</span><br/>
                            余额：<span class="text-warning">{:floatval($row['deductcredit2'])}</span>
                        </td>
                        <td>{$row['discountprice']}</td>
                        <td>{$row['isdiscountprice']}</td>
                        <td>{$row['price']}</td>
                        <!--<td style="overflow:visible;">-->
                            <!--div class="btn-group btn-group-sm">
                                <a class="btn btn-default dropdown-toggle" data-toggle="dropdown" aria-expanded="false" href="javascript:;">操作 <span class="caret"></span></a>
                                <ul class="dropdown-menu dropdown-menu-left" role="menu" style='z-index: 9999'>
                                    <li><a href="{:url('merch/clearing/add',array('merchid' => $row['id'],'datetime[start]'=>$_GET['datetime']['start'],'datetime[end]'=>$_GET['datetime']['end']));}" title="生成结算单"><i class='fa fa-edit'></i> 生成结算单</a></li>
                                </ul>
                            </div-->
                        <!--</td>-->
                    </tr>
                    {/foreach}
                </tbody>
                <tfoot>
                    <tr>
                        <td colspan="7" class="text-right">
                            {$pager}
                        </td>
                    </tr>
                </tfoot>
            </table>
        {/if}

</div>
{include file='_footer'}